﻿using TI_BLE_HCI_ClientLib.BaseEntities;
using TI_BLE_HCI_ClientLib.HCIBaseEntities;

namespace TI_BLE_HCI_ClientLib.GenericHCIEntities
{
    public class HCIVendorSpecificEvent : HCIEvent
    {
        public HCIVendorSpecificEvent()
            : base()
        {
            base.EventCode = (byte)HCIEventEventCode.HCI_LE_ExtEvent;
        }

        public HCIVendorSpecificEvent(HCIVendorSpecificEventEOGF eogf, HCIVendorSpecificEventESG esg, byte eventCode)
            : this()
        {
            base.Parameters = new BaseEntityParameter[1];

            base.Parameters[0] = new WordParameter((ushort)(((byte)eogf << 10) + ((byte)esg << 7) + eventCode));
        }

        public HCIVendorSpecificEvent(ushort eventOpcode)
            : this()
        {
            base.Parameters = new BaseEntityParameter[1];

            base.Parameters[0] = new WordParameter(eventOpcode);
        }
    }
}